<!DOCTYPE html>
<html>

<head>
    <title>提问</title>
    <meta charset="utf-8"/>
    <meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
    <link rel="stylesheet" href="/js/bootstrap/css/bootstrap.min.css">
    <script src="/js/jquery/jquery.min.js"></script>
    <script src="/js/bootstrap/js/bootstrap.min.js"></script>
    <link rel="stylesheet" href="/css/font/css/font-awesome.min.css"/>
    <link rel="stylesheet" href="/css/reset.css"/>
    <link rel="stylesheet" href="/css/editTravels.css"/>
    <script src="/js/plugins/jrender/jrender.min.js"></script>
    <link rel="stylesheet" href="/js/plugins/dialog2/dialog.css"/>
    <script src="/js/plugins/dialog2/dialog.min.js"></script>
    <script src="/js/plugins/jquery-form/jquery.form.js"></script>
    <script src="/js/plugins/eleditor/Eleditor.min.js"></script>
    <script src="/js/plugins/eleditor/webuploader.min.js"></script>
    <script src="/js/plugins/My97DatePicker/WdatePicker.js"></script>
    <script src="/js/common.js"></script>

</head>

<body>
<div class="search-head">
    <div class="row nav-search">
        <div class="col-2">
            <a href="javascript:window.history.go(-1);">
                <span><i class="fa fa-times"></i></span>
            </a>
        </div>
        <div class="col-5"></div>
        <div class="col" style="text-align: right;">
            <i class="fa fa-check" id="release"><span>提交</span></i>
        </div>
    </div>
</div>

<div class="travels form-group">
    <div class="cover">
        <img id="coverUrl" width="100%" height="7px"/>
    </div>
    <div class="title">
        <form id="detailForm" method="post" action="/travel/save">
            <input disabled class="form-control" id="title" placeholder="请输入内容"/>
        </form>
    </div>
    <textarea id="content" style="width:320px;height:150px;"></textarea>
    <hr/>
</div>
</body>
<script>
    $(function () {
        var params = getParams();
        if (params.travelId) {
            $("#release").click(function () {
                var content = $("#content").val();
                $.post("/collect/listComment", {travelId: params.travelId, content: content}, function (data) {
                    if (data.success) {
                        location.href = "/travelContent.html?id=" + params.travelId;
                    } else {
                        $(document).dialog({
                            type: 'notice',
                            infoText: '不能不写',
                            autoClose: 2500,
                            position: 'bottom'  // center: 居中; bottom: 底部
                        });
                    }
                })
            });

        }
        if (params.detailId) {
            $("#release").click(function () {
                var content = $("#content").val();
                $.post("/collect/listComment", {detailId: params.detailId, content: content}, function (data) {
                    if (data.success) {
                        location.href = "/strategyDetail.html?id=" + params.detailId;
                    } else {
                        $(document).dialog({
                            type: 'notice',
                            infoText: '不能不写',
                            autoClose: 2500,
                            position: 'bottom'  // center: 居中; bottom: 底部
                        });
                    }
                })
            });

        }
    })
</script>
</html>